package com.ruoyi.garbage.service.impl;

import com.ruoyi.garbage.domain.QuestionBank;
import com.ruoyi.garbage.mapper.QuestionBankMapper;
import com.ruoyi.garbage.service.IQuestionBankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 题库Service业务层处理
 *
 * @author 刘哲贤
 * @date 2023-01-07
 */
@Service
public class QuestionBankServiceImpl implements IQuestionBankService {
    @Autowired
    private QuestionBankMapper questionBankMapper;

    /**
     * 查询题库
     *
     * @param questionId 题库主键
     * @return 题库
     */
    @Override
    public QuestionBank selectQuestionBankByQuestionId(Long questionId) {
        return questionBankMapper.selectQuestionBankByQuestionId(questionId);
    }

    /**
     * 查询题库列表
     *
     * @param questionBank 题库
     * @return 题库
     */
    @Override
    public List<QuestionBank> selectQuestionBankList(QuestionBank questionBank) {
        return questionBankMapper.selectQuestionBankList(questionBank);
    }

    /**
     * 新增题库
     *
     * @param questionBank 题库
     * @return 结果
     */
    @Override
    public int insertQuestionBank(QuestionBank questionBank) {
        return questionBankMapper.insertQuestionBank(questionBank);
    }

    /**
     * 修改题库
     *
     * @param questionBank 题库
     * @return 结果
     */
    @Override
    public int updateQuestionBank(QuestionBank questionBank) {
        return questionBankMapper.updateQuestionBank(questionBank);
    }

    /**
     * 批量删除题库
     *
     * @param questionIds 需要删除的题库主键
     * @return 结果
     */
    @Override
    public int deleteQuestionBankByQuestionIds(Long[] questionIds) {
        return questionBankMapper.deleteQuestionBankByQuestionIds(questionIds);
    }

    /**
     * 删除题库信息
     *
     * @param questionId 题库主键
     * @return 结果
     */
    @Override
    public int deleteQuestionBankByQuestionId(Long questionId) {
        return questionBankMapper.deleteQuestionBankByQuestionId(questionId);
    }
}
